﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demo
{
    class User
    {   

        private string name;
        private string accout;
        private string password;

        public string Name
        {
            get { return this.name; }
            set
            {
                if (value=="sb\n")
                {
                    Boolean Flag = false;
                    Console.WriteLine("名字非法");
                }
                else
                {
                    this.name = value;
                }
             }
        }
        public string Accout
        {
            get { return this.accout; }
            set 
            {
                if (value=="\n")
                {
                    Boolean Flag = false;
                    Console.WriteLine("账号不能为空");
                }
                else
                {
                    this.accout = value;
                }
             }
        }
        public string Password
        {
            get { return this.password; }
            set
            {
                if (value == "\n")
                {
                    Boolean Flag = false;
                    Console.WriteLine("密码不能为空");
                }
                else
                {
                    this.password = value;
                }
             }
        }

       public void Say() 
       {    

            if (Flag)
            {
                Console.WriteLine("我叫{0}" + "账户：{1}" + "密码：{2}", this.Name, this.Accout, this.Password);
            }
           
        }
    }
}
